﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="SendMessage.aspx.cs" Inherits="bts_webapp.SendMessage" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2011.2.915.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <div><h2>Gởi Message</h2></div>

        <div style="clear:both;">
            <table>
                <tr>
                    <td>Tiêu đề:</td>
                    <td>
                        <telerik:RadTextBox ID="txtTitle" runat="server" Width="300px"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1"  ForeColor="Red" runat="server" Display="Dynamic"
                        ControlToValidate="txtTitle" ErrorMessage="*" EnableClientScript="true" SetFocusOnError="true" />
                    </td>
                </tr>
                <tr>
                    <td>Nội dung:</td>
                    <td>
                        <table>
                            <tr>
                                <td style="width: 450px;">
                                    <telerik:RadTextBox ID="txtContent" runat="server" Width="400px" TextMode="MultiLine" MaxLength="2000" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2"  ForeColor="Red" runat="server" Display="Dynamic"
                                            ControlToValidate="txtContent" ErrorMessage="*" EnableClientScript="true" SetFocusOnError="true" />
                                </td>
                                <td valign="bottom">
                                    <telerik:RadButton ID="btSend" runat="server" Text="Gởi Message" OnClick="btSend_Click" />
                                </td>
                                <td valign="bottom">
                                   <asp:Label ID="lblStatus" runat="server" ForeColor="Red" />             
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>

        <div>
            <div>Gởi đến:    <asp:CheckBox ID="chkAll" runat="server" Text="(Tất cả)" />   </div>
            <div>
                <asp:ScriptManager ID="sman" runat="server" />

                <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="RadGrid1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="btSend">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="lblStatus" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>

                <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" Skin="Windows7" />

                <telerik:RadGrid Skin="Windows7" runat="server" ID="RadGrid1" AutoGenerateColumns="false" 
                    AllowPaging="false" OnNeedDataSource="RadGrid1_NeedDataSource" 
                    OnItemDataBound="RadGrid1_ItemDataBound" AllowSorting="true" AllowFilteringByColumn="true" >
                    
                    <MasterTableView>
                        <Columns>
                            <telerik:GridTemplateColumn UniqueName="chkCol" HeaderText="Chọn">
                                <ItemTemplate>
                                    <asp:CheckBox runat="server" ID="chkSelectedUser" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="User_Id" HeaderText="Mã nhân viên" UniqueName="UserId" SortExpression="User_Id" />
                            <telerik:GridBoundColumn DataField="User_Full_Name" HeaderText="Họ và tên" UniqueName="UserFullname" SortExpression="User_Full_name" />
                            <telerik:GridBoundColumn DataField="User_Address" HeaderText="Địa chỉ" UniqueName="Address" SortExpression="User_Address" />
                            <telerik:GridBoundColumn DataField="User_Phone" HeaderText="Số điện thoại" UniqueName="Phone" SortExpression="User_Phone"/>
                            <telerik:GridBoundColumn DataField="User_Email" HeaderText="Email" UniqueName="Email" SortExpression="User_Email"/>
                        </Columns>
                    </MasterTableView>
            
                </telerik:RadGrid>

            </div>
        </div>
    </div>
</asp:Content>
